package com.wen.open.springframework.test.bean;

import com.wen.open.springframework.stereotype.Component;

/**
 * @author Wen
 * @date 2023/4/23 11:19
 */
@Component
public class UserService {
    private String uid;

    private String location;

    private int age;

    private UserDao userDao;

    private IUserDao proxyUserDao;

    public IUserDao getProxyUserDao() {
        return proxyUserDao;
    }

    public void setProxyUserDao(IUserDao proxyUserDao) {
        this.proxyUserDao = proxyUserDao;
    }

    public void queryUserInfo() {
        System.out.println(this);
        System.out.println(proxyUserDao.queryUserInfo(uid));
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "UserService{" +
                "uid='" + uid + '\'' +
                ", location='" + location + '\'' +
                ", age=" + age +
                ", userDao=" + userDao +
                '}';
    }

    public String show() {
        return "Service load success";
    }
}
